<?php
/*****************************************************
 * File name: SpellsModel.php
 * Create date: 2019/03/28
 * Author: liuyue
 * Description: 技能数据库接口
 *****************************************************/

namespace Model;

use Lib;

class SpellsModel
{
    private $db = null;

    public function __construct()
    {
        $this->db = Lib\Db\DbModel::init(); // 构造方法，线上自动切换

    }

    /**
     * 根据英雄Id以及版本Id获取英雄技能信息
     * @param $heroId
     * @param $versionId
     * @return array
     */
    public function getHeroSpellsInfo($heroId,$versionId)
    {
        //条件
        $where = [
            'heroId' =>$heroId,
            'versionId' =>$versionId,
            'isDelete' =>0
        ];
        $heroSpells = $this->db->table('tbspells')->where($where)->select();
        return $heroSpells;
    }
}